﻿using System.Data.Entity.ModelConfiguration;
using HouseHoldBudget.Core.Entities.Incomes;

namespace HouseHoldBudget.Data.Mapping.Incomes
{
    public class OccasionalIncomeMap: EntityTypeConfiguration<OccasionalIncome>
    {
        #region Constructors

        public OccasionalIncomeMap()
        {
            ToTable("OccasionalIncomes");
            HasKey(p => p.Id);

            HasRequired(fp => fp.BudgetUser)
                .WithMany(p => p.OccasionalIncomes)
                .HasForeignKey(fp => fp.BudgetUserId)
                .WillCascadeOnDelete(false);
        }

        #endregion
    }
}
